/**
 * 
 */
package cc.telecomdigital.tdstock.activity.groups.more.push.util;

import java.util.HashMap;

/**
 * 
 * Project：stringutil Class：CharWord desc： Createor：hunter Create Time：16 Oct
 * 2011 10:18:58 Modify：hunter Modify Time：16 Oct 2011 10:18:58 Modify Marks：
 * 字符工具类
 * 
 * @version 1.0
 * 
 */
public class CharWord
{
	/**
	 * char is china
	 * 
	 * @param s
	 * @return
	 */
	public static boolean isCH_ZN(String s)
	{
		if (s.matches("[\\u4e00-\\u9fbf]+"))
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	/**
	 * char convert to Integer
	 * 
	 * @param Char
	 * @return
	 */
	public static Integer charToInteger(String Char)
	{
		Integer num = 0;
		HashMap<String, Integer> maps = Contant.getMap();
		for (String key : maps.keySet())
		{
			if (key.equals(Char))
			{
				num = maps.get(key);
			}
		}
		return num;
	}

	/**
	 * integer convert char
	 * 
	 * @param Int
	 * @return
	 */
	public static String integerToChar(Integer Int)
	{
		String temp = "";
		HashMap<String, Integer> maps = Contant.getMap();
		for (String key : maps.keySet())
		{
			if (maps.get(key) == Int)
			{
				temp = key;
			}
		}
		return temp;
	}
}
